<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="场次">
              <j-dict-select-tag v-model="queryParam.sceneId" dictCode="msms_scene, start_time, id, del_flag=0" placeholder="全部" clearable/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
                <a-button type="primary" icon="download" @click="handleExportXls('秒杀统计')" style="margin-left: 8px">导出</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
    </div>

    <!-- table区域-begin -->
    <div class="pgc">

      <a-table
        ref="table"
        :scroll="{x:true}"
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="text" height="50px" alt="" style="max-width:120px;font-size: 12px;font-style: italic;" />
        </template>
        <template slot="rankSlot" slot-scope="text, record, index">
          <span>{{ (ipagination.current - 1) * ipagination.pageSize + parseInt(index) + 1 }}</span>
        </template>
        <template slot="titleSlot" slot-scope="text">
          <j-ellipsis :value="text" :length="20" />
        </template>
      </a-table>
    </div>

  </a-card>
</template>

<script>

  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import JInput from '@/components/jeecg/JInput';
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import '@/assets/less/TableExpand.less'

  export default {
    name: 'UmsBalanceLogList',
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      JInput,
      JEllipsis
    },
    data () {
      return {
        description: '拼团统计',
        // 表头
        columns: [
          {
            title: '排名',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            scopedSlots: { customRender: 'rankSlot' }
          },
          {
            title:'商品图片',
            align:"center",
            dataIndex: 'imgUrl',
            scopedSlots: { customRender: 'imgSlot' }
          },
          {
            title:'商品名称',
            align:"center",
            dataIndex: 'title',
            width: 250,
          },
          {
            title:'支付件数',
            align:"center",
            dataIndex: 'payCount'
          },
          {
            title:'支付金额',
            align:"center",
            dataIndex: 'payAmount',
          },
          {
            title:'下单人数',
            align:"center",
            dataIndex: 'memberCount',
          },
        ],
        url: {
          list: "/statistics/msmsGoodStatistics",
          exportXlsUrl: "/statistics/msmsGoodExportXls",
        },
        sumData: {
          balanceTotal: 0,
          usedTotal: 0,
        },
        dictOptions:{},
      }
    },
    created() {
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>